package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维护-维护方式
type vehicleMaintainWay int

var VehicleMaintainWay vehicleMaintainWay

// 修
func (c *vehicleMaintainWay) Repair() int {
	return 1
}

// 换
func (c *vehicleMaintainWay) Change() int {
	return 2
}

func (c *vehicleMaintainWay) ToText(value int) string {
	switch value {

	case 1:
		return "修"

	case 2:
		return "换"

	}
	return ""
}

func (c *vehicleMaintainWay) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainWay) ToValue(text string) int {
	switch text {

	case "修":
		return 1

	case "换":
		return 2

	}
	return 0
}
